//
//  WTGetCoinService.m
//  WTLiveSDKDemo
//
//  Created by ben on 16/10/7.
//  Copyright © 2016年 ben. All rights reserved.
//

#import "WTGetCoinService.h"

@implementation WTGetCoinService

- (void)start:(NSDictionary *)param completionHandler:(WTServiceCompletionHandler)completionHandler{
    
    self.subPath = @"/my_coins";
    self.param = param;
    
    [HYBNetworking postWithUrl:self.subPath refreshCache:YES params:@{@"hash":[self encode]} success:^(id response) {
        
        NSInteger code = [response[@"code"] integerValue];
        if(code == 200){
            NSNumber* totalNumber = response[@"hash"][@"carrots"];
            completionHandler(totalNumber,nil);
        }else {
            completionHandler(nil,nil);
        }
        
    } fail:^(NSError *error) {
        completionHandler(nil,error);
    }];
}
@end
